<?php

/**
 * @Author: xuebingsi
 * @Date:   2018-07-09 19:33:24
 * @Last Modified by:   zhibinm
 * @Last Modified time: 2018-07-09 19:35:31
 */
$ch = curl_init();

$data = array('name' => 'Foo', 'file' => '@/home/user/test.png');

curl_setopt($ch, CURLOPT_URL, 'http://www.abc.com/v1/index/getUserInfo?uid=1');
curl_setopt($ch, CURLOPT_POST, 1);
// curl_setopt($ch, CURLOPT_SAFE_UPLOAD, false); //  PHP 5.6.0 后必须开启
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);

curl_exec($ch);